package com.sunrate.investingquote.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sunrate.investingquote.bean.IvPid;
import com.sunrate.investingquote.mapper.IvPidMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 作者
 * @since 2023-06-15 14:57:27
 */
@Service
public class IvPidDao extends ServiceImpl<IvPidMapper, IvPid> {


    public List<IvPid> listIvPid() {
        LambdaQueryWrapper<IvPid> wrapper = new LambdaQueryWrapper<>();
        return baseMapper.selectList(wrapper);
    }


    public IvPid getByPairId(String pairId) {
        LambdaQueryWrapper<IvPid> wrapper = Wrappers.lambdaQuery(IvPid.class)
                .eq(IvPid::getPairId, pairId);
        return baseMapper.selectOne(wrapper);
    }
}
